from re_common.baselibrary.tools.all_requests.aiohttp_request import AioHttpRequest

from apps.crawler_platform.core_abs.downstepabs import ParaItems


def core_down_befor_callback(pm: ParaItems):
    """
    调用rrq前的callback
    """
    if pm.keys == "1_3" and pm.task_name == "cnkijournal" and pm.task_tag == "cnkiarticle":
        if (pm.turn_page == 5 and pm.params["page"] == "1") or (pm.turn_page == 6 and pm.params["page"] == "0"):
            del pm.params["CurDBCode"]
            del pm.params["page"]



def core_down_after_callback(pm: ParaItems, rrq: AioHttpRequest, bools, dicts):
    # self.down_dicts["url"] = self.pm.url
    # self.down_dicts["time_out"] = self.pm.time_out
    # self.down_dicts["header"] = self.pm.this_header
    # self.down_dicts["marks"] = self.pm.marks
    # self.down_dicts["proxy"] = self.pm.proxy
    # self.down_dicts["params"] = self.pm.params
    # self.down_dicts["req_type"] = self.pm.req_type
    pass
